﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using DataAnnotationsExtensions;

namespace Qu.ComputingContest.Model
{
    [MetadataType(typeof(StudentMetadata))]
    public partial class Student
    {
    }

    public class StudentMetadata
    {
        [Required]
        [DisplayName("First Name")]
        [StringLength(50, ErrorMessage = "50 Characters maximum")]
        public string FirstName { get; set; }

        [Required]
        [DisplayName("Middle Name")]
        [StringLength(50, ErrorMessage = "50 Characters maximum")]
        public string MiddleName { get; set; }

        [Required]
        [DisplayName("Last Name")]
        [StringLength(50, ErrorMessage = "50 Characters maximum")]
        public string LastName { get; set; }

        [Required]
        [MaxLength(1, ErrorMessage = "1 Character maximum")]
        public string Gender { get; set; }

        [Required]
        [Digits]
        [DisplayName("School Year")]
        public int SchoolYear { get; set; }

        [Required]
        [Email]
        [MaxLength(50, ErrorMessage = "50 Characters maximum")]
        [DataType(DataType.EmailAddress)]
        public string Email { get; set; }

        [Digits]
        [DisplayName("Mobile Number")]
        [MinLength(8, ErrorMessage = "The phone number must be 8 digits minimum")]
        [MaxLength(10, ErrorMessage = "The phone number can be 10 digits maximum")]
        public string Phone { get; set; }
    }
}
